Merge "Removed unusable maintenance script"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 8 Apr 2015 22:53:30 +0000 (22:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 8 Apr 2015 22:53:30 +0000 (22:53 +0000)
includes/api/ApiParse.php

index 73bea83..b565dea 100644 (file)
@@ -107,7 +107,10 @@ class ApiParse extends ApiBase {
                                $popts = $this->makeParserOptions( $pageObj, $params );
 
                                // If for some reason the "oldid" is actually the current revision, it may be cached
-                               if ( $rev->isCurrent() ) {
+                               // Deliberately comparing $pageObj->getLatest() with $rev->getId(), rather than
+                               // checking $rev->isCurrent(), because $pageObj is what actually ends up being used,
+                               // and if its ->getLatest() is outdated, $rev->isCurrent() won't tell us that.
+                               if ( $rev->getId() == $pageObj->getLatest() ) {
                                        // May get from/save to parser cache
                                        $p_result = $this->getParsedContent( $pageObj, $popts,
                                                $pageid, isset( $prop['wikitext'] ) );